#include <stdio.h>
int main()
{
    __int64 n;
    int m;
    scanf("%d",&m);
    while (m--)
    {
        scanf("%I64d",&n);
        n=n*2-1;
        printf("%I64d\n",(n*n+n+2)/2);
    }
    return 0;
}
